klass->create_menu_item = create_menu_item;
klass->create_tool_item = create_tool_item;
klass->create_menu = NULL;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
klass->menu_item_type = GTK_TYPE_IMAGE_MENU_ITEM;
+ G_GNUC_END_IGNORE_DEPRECATIONS;
klass->toolbar_item_type = GTK_TYPE_TOOL_BUTTON;
klass->connect_proxy = connect_proxy;
klass->disconnect_proxy = disconnect_proxy;
#include "config.h"
+#define GDK_DISABLE_DEPRECATION_WARNINGS
+
#include "gtkimagemenuitem.h"
#include "gtkmenuitemprivate.h"
gobject_class->set_property = gtk_image_menu_item_set_property;
gobject_class->get_property = gtk_image_menu_item_get_property;
+ /**
+ * GtkImageMenuItem:image:
+ *
+ * Child widget to appear next to the menu text.
+ *
+ * Deprecated: 3.10
+ */
g_object_class_install_property (gobject_class,
PROP_IMAGE,
g_param_spec_object ("image",
* without the image.
*
* Since: 2.16
+ *
+ * Deprecated: 3.10
*/
g_object_class_install_property (gobject_class,
PROP_ALWAYS_SHOW_IMAGE,
* Creates a new #GtkImageMenuItem with an empty label.
*
* Returns: a new #GtkImageMenuItem
+ *
+ * Deprecated: 3.10: Use gtk_menu_item_new() instead.
*/
GtkWidget*
gtk_image_menu_item_new (void)
* Creates a new #GtkImageMenuItem containing a label.
*
* Returns: a new #GtkImageMenuItem.
+ *
+ * Deprecated: 3.10: Use gtk_menu_item_new_with_label() instead.
*/
GtkWidget*
gtk_image_menu_item_new_with_label (const gchar *label)
* in @label indicate the mnemonic for the menu item.
*
* Returns: a new #GtkImageMenuItem
+ *
+ * Deprecated: 3.10: Use gtk_menu_item_new_with_mnemonic() instead.
*/
GtkWidget*
gtk_image_menu_item_new_with_mnemonic (const gchar *label)
* without the image.
*
* Since: 2.16
+ *
+ * Deprecated: 3.10
*/
void
gtk_image_menu_item_set_always_show_image (GtkImageMenuItem *image_menu_item,
* Returns: %TRUE if the menu item will always show the image
*
* Since: 2.16
+ *
+ * Deprecated: 3.10
*/
gboolean
gtk_image_menu_item_get_always_show_image (GtkImageMenuItem *image_menu_item)
* Sets the image of @image_menu_item to the given widget.
* Note that it depends on the show-menu-images setting whether
* the image will be displayed or not.
+ *
+ * Deprecated: 3.10
*/
void
gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item,
* See gtk_image_menu_item_set_image().
*
* Return value: (transfer none): the widget set as image of @image_menu_item
+ *
+ * Deprecated: 3.10
**/
GtkWidget*
gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item)
void (*_gtk_reserved4) (void);
};
-
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10_FOR(gtk_menu_item_get_type)
GType gtk_image_menu_item_get_type (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10_FOR(gtk_menu_item_new)
GtkWidget* gtk_image_menu_item_new (void);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10_FOR(gtk_menu_item_new_with_label)
GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10_FOR(gtk_menu_item_new_with_mnemonic)
GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label);
-GDK_DEPRECATED_IN_3_10_FOR(gtk_image_menu_item_new)
+GDK_DEPRECATED_IN_3_10_FOR(gtk_menu_item_new)
GtkWidget* gtk_image_menu_item_new_from_stock (const gchar *stock_id,
GtkAccelGroup *accel_group);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_image_menu_item_set_always_show_image (GtkImageMenuItem *image_menu_item,
gboolean always_show);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
gboolean gtk_image_menu_item_get_always_show_image (GtkImageMenuItem *image_menu_item);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item,
GtkWidget *image);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item);
GDK_DEPRECATED_IN_3_10
void gtk_image_menu_item_set_use_stock (GtkImageMenuItem *image_menu_item,
GtkWidget *menuitem;
menu = gtk_recent_action_create_menu (action);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
menuitem = g_object_new (GTK_TYPE_IMAGE_MENU_ITEM, NULL);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
gtk_widget_show (menu);
action_class->create_menu_item = gtk_recent_action_create_menu_item;
action_class->create_tool_item = gtk_recent_action_create_tool_item;
action_class->create_menu = gtk_recent_action_create_menu;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
action_class->menu_item_type = GTK_TYPE_IMAGE_MENU_ITEM;
+ G_GNUC_END_IGNORE_DEPRECATIONS;
action_class->toolbar_item_type = GTK_TYPE_MENU_TOOL_BUTTON;
_gtk_recent_chooser_install_properties (gobject_class);
* The %d is the number of the item, the %s is the name of the item.
*/
text = g_strdup_printf (C_("recent menu label", "%d. %s"), count, escaped);
-
+
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
item = gtk_image_menu_item_new_with_mnemonic (text);
-
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
g_free (escaped);
g_free (name);
}
else
{
text = g_strdup (gtk_recent_info_get_display_name (info));
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
item = gtk_image_menu_item_new_with_label (text);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
}
g_free (text);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (item),
TRUE);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
/* ellipsize the menu item label, in case the recent document
* display name is huge.
icon = gtk_recent_info_get_gicon (info);
image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (item), TRUE);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
if (icon)
g_object_unref (icon);
}
label = "";
}
- G_GNUC_END_IGNORE_DEPRECATIONS;
-
if (use_mnemonic)
menu_item = gtk_image_menu_item_new_with_mnemonic (label);
else
}
else if (button->priv->stock_id)
{
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
menu_image = gtk_image_new_from_stock (button->priv->stock_id, GTK_ICON_SIZE_MENU);
- G_GNUC_END_IGNORE_DEPRECATIONS;
}
if (menu_image)
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), menu_image);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
g_signal_connect_closure_by_id (menu_item,
g_signal_lookup ("activate", G_OBJECT_TYPE (menu_item)), 0,
g_cclosure_new_object_swap (G_CALLBACK (gtk_button_clicked),
g_object_ref_sink (info->proxy);
gtk_widget_set_name (info->proxy, info->name);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
if (info->always_show_image_set &&
GTK_IS_IMAGE_MENU_ITEM (info->proxy))
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (info->proxy),
info->always_show_image);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
gtk_menu_shell_insert (GTK_MENU_SHELL (menushell),
info->proxy, pos);
}
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), menuitem);
- menuitem = gtk_image_menu_item_new_with_label (_("Close"));
+ menuitem = gtk_menu_item_new_with_label (_("Close"));
gtk_widget_show (menuitem);
if (!priv->deletable)
gtk_widget_set_sensitive (menuitem, FALSE);
image = gtk_image_new_from_icon_name ("document-open",
GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
menuitem = gtk_image_menu_item_new_with_label ("Image item");
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
image = gtk_image_new_from_icon_name ("help-broswer",
GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
menuitem = gtk_image_menu_item_new_with_label ("Image");
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 0, 1);
gtk_widget_show (menuitem);
image = gtk_image_new_from_icon_name ("help-browser",
GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
menuitem = gtk_image_menu_item_new_with_label ("Image");
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
gtk_menu_attach (GTK_MENU (submenu), menuitem, 1, 2, 1, 2);
gtk_widget_show (menuitem);
image = gtk_image_new_from_icon_name ("help-browser",
GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
menuitem = gtk_image_menu_item_new_with_label ("Help");
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (screen, 4, 5));
gtk_widget_set_hexpand (menuitem, TRUE);
gtk_widget_set_halign (menuitem, GTK_ALIGN_END);
menu = create_menu (screen, 1, 5);
gtk_menu_set_accel_group (GTK_MENU (menu), accel_group);
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_NEW, accel_group);
- G_GNUC_END_IGNORE_DEPRECATIONS;
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
- gtk_widget_show (menuitem);
-
menuitem = gtk_check_menu_item_new_with_label ("Accelerate Me");
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
- menuitem = gtk_image_menu_item_new_with_mnemonic ("_Open");
+ menuitem = gtk_menu_item_new_with_mnemonic ("_Open");
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);